/**
 * 更新用户状态业务逻辑 create by zhuchentong
 * 
 * @2017-04-21
 */
var storage = require('util/storage')
var constant = require('config/constant')
var d1 = require('deviceone')
var Device = d1.sm('do_Device')
var log =require('util/log')

module.exports.loadDeviceInfo = function(){
	var deviceInfo = Device.getInfo()
	storage.setItem(constant.storage.device_info,deviceInfo)
}

// 添加用户属性
Object.defineProperties(module.exports, {
    isIOS: {
        get: function() {
        	log.info(12310000000)
        	var data = storage.getItem(constant.storage.device_info)
        	return data.OS === 'iPhone OS'
        }
    },
    isAndroid: {
        get: function() {
        	log.info(89898998)
        	var data = storage.getItem(constant.storage.device_info)
        	return data.OS === 'android'
        }
    }
})